<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>修改密码</title>
	<%@ include file="/WEB-INF/views/include/head.jsp" %>
	<script type="text/javascript">
		$(document).ready(function() {
			$("#inputForm").validate({
				rules: {
				},
				messages: {
					confirmNewPassword: {equalTo: "输入与上面相同的密码"}
				},
				submitHandler: function(form){
					form.submit();
				},
				errorClass: 'validation-invalid-label',
				highlight: function(element, errorClass) {
					$(element).removeClass(errorClass);
				},
				errorPlacement: function (error, element) {
					validateErrorPlacement(error, element);
				}
			});
		});
	</script>
</head>
<body>
<div class="content">
	<sys:message content="${message}"/>
	<div class="card m-0 border-0">
		<div class="card-body">
			<form:form id="inputForm" method="post"
					   modelAttribute="user" action="${ctxAdmin}/sys/user/modifyPwd" >
				<form:hidden path="id"/>
				<div class="form-group row">
					<label class="col-sm-2 col-form-label">旧密码</label>
					<div class="col-sm-4">
						<input id="oldPassword" name="oldPassword" type="password" value="" maxlength="50" minlength="3" class="required form-control"/>
					</div>
				</div>
				<div class="form-group row">
					<label class="col-sm-2 col-form-label">新密码</label>
					<div class="col-sm-4">
						<input id="newPassword" name="newPassword" type="password" value="" maxlength="50" minlength="3" class="required form-control"/>
					</div>
				</div>
				<div class="form-group row">
					<label class="col-sm-2 col-form-label">确认新密码</label>
					<div class="col-sm-4">
						<input id="confirmNewPassword" name="confirmNewPassword" type="password" value="" maxlength="50" minlength="3" class="required form-control" equalTo="#newPassword"/>
					</div>
				</div>
				<div class="form-group row mb-0">
					<div class="col-sm-10 ml-sm-auto">
						<button type="submit" class="btn btn-primary"><i class="icon-database-check mr-2"></i>保 存</button>
					</div>
				</div>
			</form:form>
		</div>
	</div>
</div>
</body>
</html>